package cn.myframe.entity.tb;

import cn.myframe.utils.annotation.IgnoreCopy;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
 * 
 * 
 * @author ynz
 * @email ynz@myframe.cn
 * @date 2018-12-08 14:58:47
 */
@TableName("tb_user")
public class TbUserEntity implements Serializable {
	private static final long serialVersionUID = 1L;
	
	// 	
	@TableId("user_id")
    private Long userId;
	//操作员名称	
	@TableField("name")
    @IgnoreCopy
    private String name;
	//操作员编号	
	@TableField("user_no")
    @IgnoreCopy
    private String userNo;
	//操作员类型	
	@TableField("user_type")
    private Integer userType;
	//状态	
	@TableField("status")
    private Integer status;
	//区域	
	@TableField("region")
    private Long region;
    // 
    @TableField(exist = false)
    private String regionName;
    @TableField(exist = false)
    private TbRegionEntity tbRegionEntity;
	// 	
	@TableField("roles")
    private String roles;
    @TableField(exist = false)
    private List<TbRoleEntity> tbRoleList;
    @TableField(exist = false)
    private List<Long> tbRoleIdsList;

	/**
	 * 设置： 
	 */
	public void setUserId(Long userId) {
		this.userId = userId;
	}
	/**
	 * 获取： 
	 */
	public Long getUserId() {
		return userId;
	}
	/**
	 * 设置：操作员名称
	 */
	public void setName(String name) {
		this.name = name;
	}
	/**
	 * 获取：操作员名称
	 */
	public String getName() {
		return name;
	}
	/**
	 * 设置：操作员编号
	 */
	public void setUserNo(String userNo) {
		this.userNo = userNo;
	}
	/**
	 * 获取：操作员编号
	 */
	public String getUserNo() {
		return userNo;
	}
	/**
	 * 设置：操作员类型
	 */
	public void setUserType(Integer userType) {
		this.userType = userType;
	}
	/**
	 * 获取：操作员类型
	 */
	public Integer getUserType() {
		return userType;
	}
	/**
	 * 设置：状态
	 */
	public void setStatus(Integer status) {
		this.status = status;
	}
	/**
	 * 获取：状态
	 */
	public Integer getStatus() {
		return status;
	}
	/**
	 * 设置：区域
	 */
	public void setRegion(Long region) {
		this.region = region;
	}
	/**
	 * 获取：区域
	 */
	public Long getRegion() {
		return region;
	}
    /**
	 * 设置： 
	 */
    public void setRegionName(String regionName) {
		this.regionName = regionName;
	}
	/**
	 * 获取： 
	 */
	public String getRegionName() {
	    if(tbRegionEntity != null){
			return tbRegionEntity.getRegionName();
		}  
		return regionName;
	}	
	public void setTbRegionEntity(TbRegionEntity tbRegionEntity) {
		this.tbRegionEntity = tbRegionEntity;
	}
	public TbRegionEntity getTbRegionEntity() {
		return tbRegionEntity;
	}
	/**
	 * 设置： 
	 */
	public void setRoles(String roles) {
		this.roles = roles;
	}
	/**
	 * 获取： 
	 */
	public String getRoles() {
		return roles;
	}
    public List<TbRoleEntity> getTbRoleList(){
        return tbRoleList;
    }
    public void setTbRoleList(List<TbRoleEntity> tbRoleList){
        this.tbRoleList = tbRoleList;
    }
    public List<Long> getTbRoleIdsList(){
	    if(tbRoleList != null && (tbRoleIdsList == null || tbRoleIdsList.size()== 0)){
	           List<Long> list = new ArrayList<Long>();
	           for(TbRoleEntity entity : tbRoleList){
	               list.add(entity.getRoleId());
	           }
	           return list;
	     }
         return tbRoleIdsList; 
    }
    public void setTbRoleIdsList(List<Long> tbRoleIdsList){
        this.tbRoleIdsList = tbRoleIdsList;
    }
}
